'use strict';

const Controller = require('egg').Controller;

class ContController extends Controller {
    async qqq() {
        const { ctx } = this;
        let res = { "code": 0, "msg": "成功" };
        const qqq = ctx.request.query;
        // reply.cid = ctx.session.cid;
        console.log(22, qqq);
        const results = await this.app.mysql.select('comments', { // 搜索 post 表
            where: { cid: qqq.cid }, // WHERE 条件
            columns: ['addtimes', 'content'], // 要查询的表字段
        });

        //   select addtimes,content from comments where cid = 2;
        //  INSERT INTO `posts`(`title`) VALUES('Hello World');
        // console.log(r);
        // res = r;
        ctx.body = results;

    }
}


module.exports = ContController;
